﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace Alex.Library.Net.Web
{
    /// <summary>
    /// Http请求参数
    /// </summary>
    public class HttpRequestParamter
    {
        #region Ctors

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="method">请求方式</param>
        /// <param name="contentType">内容类型</param>
        /// <param name="content">请求内容</param>
        public HttpRequestParamter(HttpRequestMethod method, string contentType, byte[] content)
        {
            this.Method = method;
            this.ContentType = contentType;
            this.Content = content;
        }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="method">请求方式</param>
        /// <param name="contentType">内容类型</param>
        public HttpRequestParamter(HttpRequestMethod method, string contentType)
            : this(method, contentType, null)
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        public HttpRequestParamter()
            : this(HttpRequestMethod.GET, "text/html")
        {

        }

        #endregion

        #region Propertities

        /// <summary>
        /// Http Request Method, default:GET
        /// </summary>
        public HttpRequestMethod Method { get; set; }

        /// <summary>
        /// Http Request Timeout
        /// </summary>
        public int Timeout { get; set; }

        /// <summary>
        /// Http Request ContentType, default:text/html;charset=utf-8
        /// </summary>
        public string ContentType { get; set; }

        /// <summary>
        /// Http Request Accept, default: application/json
        /// </summary>
        public string Accept { get; set; }

        /// <summary>
        /// Http Request AcceptCharset, default:utf-8
        /// </summary>
        public string AcceptCharset { get; set; }

        /// <summary>
        /// Http Request UserAgent.
        /// </summary>
        public string UserAgent { get; set; }

        /// <summary>
        /// Http Request ETAG, If not change return 304 otherwise return 200.
        /// </summary>
        public string IfNoneMatch { get; set; }

        /// <summary>
        /// Http Request Proxy, default: use default Proxy of your machine.
        /// </summary>
        public IWebProxy Proxy { get; set; }

        /// <summary>
        /// Http Request Content
        /// </summary>
        public byte[] Content { get; set; }

        /// <summary>
        /// 获取或设置响应流数据的开始位置
        /// </summary>
        public long RequestRange { get; set; }

        #endregion
    }
}
